#!/bin/bash

set -e
set -x

bypy download kafka_2.13-2.4.1.tgz
tar xf kafka_2.13-2.4.1.tgz -C /opt/
ln -fs /opt/kafka_2.13-2.4.1 /opt/kafka
cp server.properties /opt/kafka/config/
source /etc/profile
echo "JAVA=$JAVA_HOME" >> /opt/kafka/env
echo "PATH=$PATH" >> /opt/kafka/env
cp kafka.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl enable --now kafka

set +x
set +e
